Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Pixel Types

The pixelType field of a pixmap or a storage pixmap specifies the type of pixel in the pixmap. You can use these constants to specify a pixel type:

typedef enum TQ3PixelType {
    kQ3PixelTypeRGB32                   = 0,
    kQ3PixelTypeARGB32                  = 1,
    kQ3PixelTypeRGB16                   = 2,
    kQ3PixelTypeARGB16                  = 3.
    kQ3PixelTypeRGB16_565               = 4,
    kQ3PixelTypeRGB24                   = 5
} TQ3PixelType;

Constant descriptions

kQ3PixelTypeRGB32
A pixel occupies 32 bits of memory, with the red component in bits 23 through 16, the green component in bits 15 through 8, and the blue component in bits 7 through 0. There is no per-pixel alpha channel value. As a result, the pixmap (perhaps defining a texture) is treated as opaque. (You can, however, apply transparency to the pixmap using the alpha channel values of a triangle vertex, for instance.)
kQ3PixelTypeARGB32
A pixel occupies 32 bits of memory, with the red component in bits 23 through 16, the green component in bits 15 through 8, and the blue component in bits 7 through 0. In addition, the pixel's alpha channel value is in bits 31 through 24. When the alpha value is 255, the pixmap is opaque; when the alpha value is 0, the pixmap is completely transparent.
kQ3PixelTypeRGB16
A pixel occupies 16 bits of memory, with the red component in bits 14 through 10, the green component in bits 9 through 5, and the blue component in bits 4 through 0. There is no per-pixel alpha channel value. As a result, the pixmap (perhaps defining a texture) is treated as opaque. (You can, however, apply transparency to the pixmap using the alpha channel values of a triangle vertex, for instance.)
kQ3PixelTypeARGB16
A pixel occupies 16 bits of memory, with the red component in bits 14 through 10, the green component in bits 9 through 5, and the blue component in bits 4 through 0. In addition, the pixel's alpha channel value is in bit 15. When the alpha value is 1, the pixmap is opaque; when the alpha value is 0, the pixmap is completely transparent.
kQ3PixelTypeRGB16_565
A pixel occupies 16 bits of memory, with the red component in bits 15 through 11, the green component in bits 10 through 5, and the blue component in bits 4 through 0. There is no per-pixel alpha channel value. This pixel type is currently defined only for Windows 32 devices.
kQ3PixelTypeRGB24
A pixel occupies 24 bits of memory, with the red component in bits 23 through 16, the green component in bits 15 through 8, and the blue component in bits 7 through 0. There is no per-pixel alpha channel value. This pixel type is currently defined only for Windows 32 devices.

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |